package com.epower.base;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.ali.luna.commons.log.LocalLogBuffer;

public class BaseBO {
	protected Log loger = LogFactory.getLog(this.getClass());

	protected void bizError(String errorMessage) {
		loger.error(errorMessage);
		clearOperationLogs();
	}

	protected void bizError(String errorMessage, Exception e) {
		loger.error(errorMessage, e);
		clearOperationLogs();
	}
    protected final Log logger = LogFactory.getLog(getClass());
    
    public void addOperationLog(String opType,String opName,String objectID,String opDetail, String logType) {
        LocalLogBuffer.add(new String[]{opType,opName,objectID,opDetail,logType});
    }
    
    public void clearOperationLogs() {
        LocalLogBuffer.clear();
    }
}


